#include "gofgame/dungeonkeeper/game/unit/paladin.h"

using namespace gofgame::dungeonkeeper::game::unit;


Paladin::Paladin(){
	id = 205;
}

Paladin::~Paladin(){
}

bool Paladin::init(){
	bool pRet = false;
	do 
	{
		unitType = UnitType::createById(this->id);
		texture = CCSprite::create(unitType.imageName);
		this->addChild(texture);
		updateState();
		Unit::init();
		pRet = true;
	} while (0);
	return pRet;
}

Paladin * Paladin::createByLevel(int lv){
	Paladin *paladin = new Paladin();
	if(paladin){
		paladin->lv = lv;
		if( paladin->init()){
			return paladin;
		} else {
			return nullptr;
		}
	} else{
		return nullptr;
	}
}

void Paladin::initData(){
	unitType.updateLv(lv);
	this->origHp = unitType.getBaseHP();
	this->currentHp = origHp;
	this->atk =  unitType.getBaseAtk();
	this->def =  unitType.getBaseDef();
	this->speed = unitType.getBaseSpeed();
	this->attkSpeed = unitType.getBaseAttackSpeed();
	this->range = unitType.getBaseRange();
}


void Paladin::doAI(){

}
